@echo on
echo ----- %date:~0,10% -----
echo Running dump... 
mysqldump -ufox -pG3bNu7$0n sethdb > c:\bu\buSethdb%date:~0,2%%date:~3,2%%date:~6,4%.sql
IF ERRORLEVEL 1 GOTO error
echo Dump done
echo Compressing file...
7z.exe a -tzip c:\bu\buSethdb%date:~0,2%%date:~3,2%%date:~6,4%.zip c:\bu\buSethdb%date:~0,2%%date:~3,2%%date:~6,4%.sql
IF ERRORLEVEL 1 GOTO error 
DEL /F c:\bu\buSethdb%date:~0,2%%date:~3,2%%date:~6,4%.sql
echo File compressed
echo Deleting oldest back up
cd c:\bu\
forfiles /m *.zip /c "cmd /c DEL /F @PATH" /d -8
echo Task Completed. Bye
GOTO End
:error
echo An Error Occurred
GOTO End
:end